<div class="properties-rows">
<div class="row"><?php foreach ($agents as $listing) { ?>
<div class="agent span9">
	<div class="row">
		<div class="image span2">
			<div class="content">
				<?php if($listing['image']) { ?>
					<img src="<?php echo $listing['image']; ?>" alt="<?php echo $listing['busniessname']; ?>">
				<?php } else { ?>
					<img src="<?php echo $this->config->item('HTTP_AGENTS_MEDIA_IMAGE'); ?>no-image.png" alt="No Image">
				<?php } ?>
			</div>
			<!-- /.content -->
		</div>
		<!-- /.image -->
		<div class="body span7">
			<div class="row-fluid">
				<div class="title-price title-agent span12">
					<div class="title">
						<h2><a href="<?php echo  base_url(); ?>find-an-expert/detail/<?php echo $listing['agent_id']; ?>"><?php echo $listing['busniessname']; ?></a></h2>
					</div>
					<!-- /.title -->
				</div>
				<!-- /.title -->
			</div>
			<div class="row-fluid">
				<div class="title-agent span4 offset2">
					<div class="title">
						<a href="javascript:void();">Broker with Douglas Elliman</a>
					</div>
					<div class="mobile">
						<a href="javascript:void();"><?php echo $listing['mobile']; ?></a>
					</div>
					<!-- /.location -->
				</div>
				<!-- /.title -->
				<div class="title-agent span3">
					<div class="status">
						
					</div>
					<?php if($listing['total_listing'] > 0) { ?>
					<div class="status">
						<?php echo $listing['total_listing']; ?> Active listings
					</div>
					<?php } ?>
				</div>
				<div class="span3">
					<button class="btn btn-primary find_an_expert_btn" data-toggle="modal" data-target="#myModal_<?php echo $listing['agent_id']; ?>">
						Contact This Agent
					</button>
					<input type="hidden" value="<?php echo $listing['agent_id']; ?>" name="findanexpert" id="findanexpert">
				</div>
				<div id="myModal_<?php echo $listing['agent_id']; ?>" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
					<form method="post" action="?" id="validate_field_contact_agent_result">
						<div class="modal-header">
						  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
						  <h3 id="myModalLabel">Contact this Agent</h3>
						</div>
						<div class="modal-body">
							<div class="content">
						  		<div class="row-fluid">
						  			<div class="image span4">
						  				<img src="<?php echo $listing['image']; ?>" alt="<?php echo $listing['busniessname']; ?>">
						  			</div>
						  			<div class="body span8">
						  				<h3><?php echo $listing['busniessname']; ?></h3>
						  				<h5><a><?php echo $listing['mobile']; ?></a></h5>
						  			</div>
						  		</div>
					  			<div class="row-fluid">
					  				<div class="span4">
					  					<div class="row-fluid">
					  						<div class="span12">
							  					<div class="control-group">
							  						<div class="controls">
							  							<input type="text" name="agent_name" id="agent_name" class="span12" maxlength="20" placeholder="Name">
							  						</div>
							  					</div>
							  				</div>
							  			</div>
					  				</div>
					  				<div class="span4">
					  					<div class="row-fluid">
					  						<div class="span12">
							  					<div class="control-group">
							  						<div class="controls">
							  							<input type="text" name="agent_phone" id="agent_phone" class="span12" maxlength="20" placeholder="Phone">
							  						</div>
							  					</div>
							  				</div>
							  			</div>
					  				</div>
					  				<div class="span4">
					  					<div class="control-group">
					  						<div class="controls">
					  							<input type="text" name="agent_email" id="agent_email" class="span12" maxlength="20" placeholder="Email">
					  						</div>
					  					</div>
					  				</div>
					  			</div>
					  			<div class="row-fluid">
					  				<textarea class="span12" name="agent_message" id="agent_message" cols="70" rows="3"><?php echo $listing['busniessname']; ?>, I saw your profile on Indonesia Residential. I'd like to schedule time for us to talk. Please reply to this email if you are interested.</textarea>
					  			</div>
							</div>
						</div>
						<div class="modal-footer">
						  <button class="btn btn-primary">Send</button>
						</div>
					</form>
				</div>
			</div>
			<?php if($listing['recommendations'] > 0) { ?>
			<div class="row-fluid">
				<div class="title-agent span12">
					<div class="recommend pull-right">
						<?php echo $listing['recommendations']; ?> Recommandations 
					</div>
				</div>
			</div>
			<?php } ?>
		</div>
	<!-- /.body -->
	</div>
<!-- /.property --></div>
<!-- /.row --> <?php } ?></div>
<!-- /.row --></div>
<!-- /.properties-rows -->
